package com.qt.map.args;

public class ArgsDemo01 {
    public static void main(String[] args) {
        int sum = getSum(1,2,3,4,5,6,7,8,9,10);
        System.out.println(sum);;
    }
    //底层 ：就是一个数组
    //java帮忙创建好了
    public static int  getSum(int... args) {
        int sum = 0;
        for (int arg : args) {
            sum += arg;
        }
        return sum;
    }

    public static int  getSum2(int b,int... args) {
        int sum = 0;
        for (int arg : args) {
            sum += arg;
        }
        return sum;
    }

}
